<template>
  <!-- 景点详情页 -->
  <div>
    <div v-for="em in menuNav" :key="em.id">
      <div v-if="em.id == $route.query.list">
        <!-- 头部 -->
        <top-nav>
          <div class="div-top">{{ em.label }}</div>
        </top-nav>
        <!-- 轮播图 -->
        <div>
          <el-carousel height="40vw" class="block-photo">
            <el-carousel-item v-for="e in em.photo" :key="e.id">
              <img class="photo" :src="e.img" alt="" />
            </el-carousel-item>
          </el-carousel>
        </div>
        <div class="name-label">{{ em.label }}</div>
        <p class="top">
          <span class="top-span1">简介：</span>
          <span class="top-span2">{{ em.content }}</span>
          <span class="top-span3">阅读全文</span>
        </p>
        <div class="kongbai"></div>
        <p class="concent">
          <img src="../assets/时间@2x.png" alt="" />
          <span>{{ em.time }}</span>
        </p>
        <div class="concent1">
          <div class="left"><img src="../assets/地址555@2x.png" alt="" /></div>
          <div class="centre">
            <div>
              <div class="d1">{{ em.label }}</div>
              <div class="d2">{{ em.path }}</div>
            </div>
            <img src="../assets/路径@3x.png" alt="" />
          </div>
          <div class="right">
            <img src="../assets/电话111@3x.png" alt="" />
          </div>
        </div>
        <div class="kongbai"></div>
        <p class="concent2">
          <span class="span1">特色活动</span>
          <span class="span2">观光、休闲</span>
        </p>
        <div class="kongbai"></div>
        <!-- 门票 -->
        <div class="concent3">
          <div class="top">门票</div>
          <div class="bottom">
            <div class="left">
              <div class="top1">
                <img src="../assets/门票@3x.png" alt="" />
                <span>{{ em.label1 }}</span>
              </div>
              <div class="bottom1">{{ em.content1 }}</div>
            </div>
            <div class="right">
              <div>
                <span class="span1">{{ em.money }}</span>
                <span v-if="em.money !== '免费'" class="span2">{{ em.span }}</span>
              </div>
              <img src="../assets/小按钮222@2x.png" alt="" />
            </div>
          </div>
        </div>
        <div class="kongbai"></div>

        <!-- 组件 -->
        <div class="componts">
          <div class="top">周边推荐</div>
          <div class="bottom">
            <button :class="{ a: title === 'FootPage' }" @click="title = 'FootPage'">美食</button>
            <button :class="{ a: title === 'HotelPage' }" @click="title = 'HotelPage'">住宿</button>
            <button :class="{ a: title === 'FeaturePage' }" @click="title = 'FeaturePage'">
              特产
            </button>
          </div>
          <KeepAlive>
            <component :is="title"></component>
          </KeepAlive>
        </div>
      </div>
    </div>
  </div>
</template>
<script src="">
import { getSceniclist } from '@/api/sceniclist';
import FootPage from '@/components/FootPage.vue';
import HotelPage from '@/components/HotelPage.vue';
import FeaturePage from '@/components/FeaturePage.vue';

export default {
  data() {
    return {
      title: 'FootPage',
      menuNav: [],
    };
  },
  created() {
    this.getSceniclist();
  },
  methods: {
    async getSceniclist() {
      const { data } = await getSceniclist();
      this.menuNav = data;
    },
  },
  components: { FootPage, HotelPage, FeaturePage },
};
</script>

<style lang="scss" scoped>
.photo {
  width: 375px;
  height: 150px;
}

.div-top {
  font-size: 17px;
  color: #333333;
  letter-spacing: 0;
  text-align: center;
  line-height: 44px;
}

.name-label {
  width: 345px;
  margin: 0 auto;
  font-size: 22px;
  color: #333333;
  margin-top: 15px;
  font-weight: 900;
}

.top {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  width: 345px;
  margin: 0 auto;
  margin-top: 15px;
  margin-bottom: 15px;

  .top-span1 {
    font-size: 13px;
    color: #333333;
    font-weight: 900;
  }

  .top-span2 {
    font-size: 13px;
    color: #151515;
    line-height: 18px;
  }
  .top-span3{
    font-size: 13px;
    color:#25A8FC;
    line-height: 18px;
  }
}

.kongbai {
  background: #f5f5f5;
  height: 10px;
}

.concent {
  width: 345px;
  margin: 0 auto;
  border-bottom: 1px solid #eeeeee;
  height: 50px;
  line-height: 50px;

  img {
    width: 14px;
    height: 14px;
  }

  span {
    font-size: 15px;
    color: #333333;
    font-weight: 900;
    margin-left: 25px;
  }
}

.concent1 {
  margin: 0 auto;
  display: flex;
  width: 345px;
  height: 80px;
  border-bottom: #eeeeee;
  justify-content: space-between;
  align-items: center;

  .left {
    height: 36px;

    img {
      width: 16px;
      height: 16px;
    }
  }

  .centre {
    display: flex;
    align-items: center;
    width: 230px;
    justify-content: space-between;

    >div {
      .d1 {
        font-size: 14px;
        color: #333333;
      }

      .d2 {
        font-size: 13px;
        color: #999999;
      }
    }

    img {
      width: 16px;
      height: 16px;
    }
  }

  .right {
    width: 45px;
    border-left: 1px solid #eeeeee;
    text-align: center;

    img {
      width: 19px;
      height: 20px;
    }
  }
}

.concent2 {
  width: 345px;
  margin: 0 auto;
  height: 50px;
  line-height: 50px;

  .span1 {
    font-size: 15px;
    color: #000000;
    font-weight: 900;
  }

  .span2 {
    font-size: 15px;
    color: #333333;
    margin-left: 20px;
  }
}

.concent3 {
  width: 345px;
  margin: 0 auto;

  .top {
    height: 40px;
    line-height: 30px;
    border-bottom: 1px solid #eeeeee;
    font-size: 17px;
    color: #333333;
    font-weight: 600;
  }

  .bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;

    .left {
      height: 50px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      .top1 {
        height: 30px;
        display: flex;
        align-items: center;

        img {
          width: 30px;
          height: 17px;
        }

        span {
          font-size: 15px;
          color: #333333;
          font-weight: 600;
          margin-left: 10px;
        }
      }

      .bottom1 {
        font-size: 13px;
        color: #bbbbbb;
      }
    }

    .right {
      height: 50px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;

      >div {
        .span1 {
          font-size: 17px;
          color: #e52f17;
        }

        .span2 {
          font-size: 12px;
          color: #151515;
        }
      }

      img {
        width: 56px;
        height: 24px;
      }
    }
  }
}

.componts {
  .top {
    height: 40px;
    line-height: 30px;
    border-bottom: 1px solid #eeeeee;
    font-size: 17px;
    color: #333333;
    font-weight: 600;
  }

  .bottom {
    width: 345px;
    margin: 0 auto;

    button {
      background: #eeeeee;
      border-radius: 14px;
      border: none;
      margin-right: 20px;
      width: 51px;
      height: 24px;
    }

    .a {
      background-image: linear-gradient(90deg, #ff3840 0%, #ff7b55 99%);
      border-radius: 14px;
      color: #ffffff;
    }
  }
}
</style>
